package cn.org.xuanguang.kepler.hormos.spring.starter;

import cn.org.xuanguang.kepler.hormos.orm.tenant.MultiTenantType;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Null;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

@Data
@Component
@ConfigurationProperties(prefix = "hormos.ds.multitenant")
public class MultiTenantOptions {

    // 租户管理,通过租户类参数来界定，包括租户的模式，选用的租户id等
    // 默认不开启
    @NotNull
    private Boolean enable = false;
    @Null
    private String tenantCode = MultiTenantType.TENANT_CODE.getValue();
    @Null
    private String tenantId = MultiTenantType.TENANT_ID.getValue();
    @Null
    private String tenantIdColumn = MultiTenantType.TENANT_ID.getValue();
    @Null
    private String tenantIdColumnType = "String";
    /**
     * 租户模式
     * 0.4 只支持字段模式 column
     * 0.5 考虑，实例模式 instance
     */
    @Null
    private String tenantType = "column";

}
